home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
6_11.lha
/
6_11
/
runtests3
< prev
next >
Wrap
Text File
|
1993-08-08
|
934b
|
42 lines
ll="plus mult min div mod"
wapall="swapplus swapmult swapmin swapdiv swapmod"
f [ $# -eq 0 ]
hen
set $all $swapall
i
or i
o
case $i in
build )
echo build sed
cp tst.in /tmp/tst.in.plus
sed 's!+!*!' < /tmp/tst.in.plus > /tmp/tst.in.mult
sed 's!+!-!' < /tmp/tst.in.plus > /tmp/tst.in.min
sed 's!+!/!' < /tmp/tst.in.plus > /tmp/tst.in.div
sed 's!+!%!' < /tmp/tst.in.plus > /tmp/tst.in.mod
for j in $all
do
echo build bc $j
bc < /tmp/tst.in.$j > /tmp/bc.out.$j
echo build swap $j
nawk '{print $3, $2, $1}' < /tmp/tst.in.$j > /tmp/tst.in.swap$j
echo build bc swap$j
bc < /tmp/tst.in.swap$j > /tmp/bc.out.swap$j
done
;;
esac
one
or i
o
case $i in
build ) ;;
* )
echo $i
./tst3 < /tmp/tst.in.$i > /tmp/tst.out.$i
nawk '{ getline bc < "/tmp/bc.out.'"$i"'"; if (NF != 5 || $5 != bc) print $0, bc }' < /tmp/tst.out.$i
;;
esac
one